﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MealCardManagement;
using System.Data.Entity.ModelConfiguration;
using System.ComponentModel.DataAnnotations.Schema;

namespace MealCardManagement.Data.Mapping
{
    public class UserConfig:EntityTypeConfiguration<User>
    {
        public UserConfig()
        {
            ToTable("User");

            HasKey(x => x.Id);

            Property(x => x.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            Property(x => x.Name)
                .HasMaxLength(40)
                .IsUnicode()
                .IsRequired();
        }
    }
}
